package cn.script.domain;

/**
 * @author 周永波
 */
public class RangePoint {

    private Point ps;

    private Point pe;

    public static RangePoint rp(int x, int y, int x1, int y1) {
        return new RangePoint(x, y, x1, y1);
    }

    public RangePoint(int x, int y, int x1, int y1) {
        this.ps = Point.point(x, y);
        this.pe = Point.point(x1, y1);
    }

    public RangePoint(Point ps, Point pe) {
        this.ps = ps;
        this.pe = pe;
    }

    public int width() {
        return Math.abs(this.pe.x() - this.ps.x());
    }

    public int high() {
        return Math.abs(this.pe.y() - this.ps.y());
    }

    public Point ps() {
        return this.ps;
    }

    public void ps(Point ps) {
        this.ps = ps;
    }

    public Point pe() {
        return this.pe;
    }

    public void pe(Point pe) {
        this.pe = pe;
    }
}
